#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2020/5/8 18:00
# @Author : wn 
# @File: encrypt.py
# @SoftWare: PyCharm
# @Site:
# @Table:
#｡◕‿◕｡｡◕‿◕｡｡◕‿◕｡

import sys
import random as r

def str_to_hex3(s):
    return [hex(ord(c)).replace('0x', '') for c in s]


def encryptPassword(strPlainText):
    temp_str = ''
    for i in strPlainText:
        rv = r.randint(0, sys.maxsize)
        rv_str = chr(rv % 255)
        iv = ord(i) ^ 86
        ivc = chr(iv)
        temp_str += rv_str
        temp_str += ivc

    list_hex3 = str_to_hex3(temp_str)
    for item in list_hex3:
        if len(item) == 1:
            index = list_hex3.index(item)
            list_hex3[index] = '0'+item
    str_hex = ''.join(list_hex3)
    return str_hex



# en = encryptPassword('qwer__8899')

